package com.yumeng.framework.persistence.mybatis.base.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * 扩展mybatis-plus的BaseMapper
 *
 * @author wxd
 * @date 2025/10/10 15:19
 */
public interface MyBaseMapper<T> extends BaseMapper<T> {

    //=============================以下内置的选装件
    //int insertBatchSomeColumn(List<T> entityList);
    //int alwaysUpdateSomeColumnById(@Param(Constants.ENTITY) T entity);


    //=============================以下为自己自定义
    //下面4个接口学习用
    //int deleteAll();
    //T findOne(Serializable id);
    //int insertBatch(List<T> entityList);
    //int updateBatchIds(List<T> entityList);

    //逻辑删除接口业务中不可直接调用，需调用MpBaseDao中封装好的方法
    int logicDeleteById(Map<String, Object> columnMap);
    int logicDeleteByIds(Map<String, Object> columnMap);
    int logicDelete(@Param(Constants.WRAPPER) Wrapper<T> wrapper);
    int logicDeleteByMap(Map<String, Object> columnMap);
}
